__author__ = 'Administrator'
from selenium.webdriver.common.by import By

from pages.BasePage import BasePage


class EnterPageLocators(object):
    USER_NAME = (By.ID, "username")
    PASSWORD = (By.ID, "password")
    ENTER_BUTTON = (By.XPATH, "//*[@type=\"submit\"]")


class EnterPage(BasePage):

    USER_NAME = "Administrator"
    PASSWORD = "FPM.BUDKO1123085"

    def __init__(self, driver):
        super(EnterPage, self).__init__(driver)
        self.pageLocation = "https://win-m4n3psr54be.contoso.local/owa"
        self.driver.maximize_window()

    def type_user_name(self):
        self.find_element(EnterPageLocators.USER_NAME).send_keys(self.USER_NAME)

    def type_password(self):
        self.find_element(EnterPageLocators.PASSWORD).send_keys(self.PASSWORD)

    def click_enter_button(self):
        self.find_element(EnterPageLocators.ENTER_BUTTON).click()